package cn.suhaoblog.faq.controller;


import cn.suhaoblog.core.door.CommonResponse;
import cn.suhaoblog.faq.entity.InterviewFaq;
import cn.suhaoblog.faq.service.InterviewFaqService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import org.springframework.web.bind.annotation.*;

import cn.suhaoblog.core.base.BaseController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author su-hao
 * @since 2024-03-20
 */
@RestController
@RequestMapping("/faq/interviewFaq")
@Api(tags = "问答模块")
public class InterviewFaqController extends BaseController {

    @Resource
    private InterviewFaqService faqService;


    @GetMapping("selectAll")
    @ApiOperation(value = "查询FAQ列表", notes = "注意不需要分页参数")
    @ApiResponse(code = 200, message = "查询成功", response = CommonResponse.class)
    public CommonResponse<List<InterviewFaq>> queryAll() {
        return new CommonResponse<List<InterviewFaq>>()
                .msg("查询成功")
                .data(faqService.list(null))
                .ok();
    }

    @DeleteMapping("deleteById")
    @ApiOperation(value = "删除节点", notes = "注意不需要分页参数")
    @ApiResponse(code = 200, message = "查询成功", response = CommonResponse.class)
    public CommonResponse<List<InterviewFaq>> delete() {
        return new CommonResponse<List<InterviewFaq>>()
                .msg("查询成功")
                .data(faqService.list(null))
                .ok();
    }

    @PutMapping("putSomething")
    @ApiOperation(value = "查询FAQ列表", notes = "注意不需要分页参数")
    @ApiResponse(code = 200, message = "查询成功", response = CommonResponse.class)
    public String putSomething() {
        return "ok";
    }

    @PostMapping("selectTest")
    @ApiOperation(value = "查询全部")
    public CommonResponse<String> query() {
        return new CommonResponse<String>()
                .msg("查询成功")
                .data("查询测试")
                .ok();
    }
}
